home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HyperLib 1997 Winter - Disc 1
/
HYPERLIB-1997-Winter-CD1.ISO.7z
/
HYPERLIB-1997-Winter-CD1.ISO
/
オンラインウェア
/
PRG
/
MacPerl 506 appl folder.sit
/
MacPerl 506 appl folder
/
Mac_Perl_506r1m_appl
/
eg
/
server
< prev
next >
Wrap
Text File
|
1994-12-26
|
571b
|
28 lines
#!./perl
$pat = 'S n C4 x8';
$inet = 2;
$echo = 7;
$smtp = 25;
$nntp = 119;
$this = pack($pat,$inet,2345, 0,0,0,0);
select(NS); $| = 1; select(stdout);
if (socket(S,2,1,6)) { print "socket ok¥n"; } else { die $!; }
if (bind(S,$this)) { print "bind ok¥n"; } else { die $!; }
if (listen(S,5)) { print "listen ok¥n"; } else { die $!; }
for (;;) {
print "Listening again¥n";
if ($addr = accept(NS,S)) { print "accept ok¥n"; } else { die $!; }
@ary = unpack($pat,$addr);
$, = ' ';
print @ary; print "¥n";
while (<NS>) {
print;
print NS;
}
}